package com.song.JavaThread_day02.ch2_8;

public class TaskMain {
	
	
	public static void main(String[] args) {
		
		FileMock mock = new FileMock(100,10);
		Buffer buffer = new Buffer(20);
		Thread pthreader[]  = new Thread[4];
		
		Consumer consumer[] = new Consumer[3];
		Producer producer[] = new Producer[4];
		Thread cthread[] = new Thread[3];
		for(int i = 0 ;i<3 ;i++)
		{
			consumer[i] = new Consumer(buffer);
			cthread[i] = new Thread(consumer[i]);
		}
		for(int i = 0 ;i<4 ;i++)
		{
			producer[i] = new Producer(mock, buffer);
			pthreader[i] = new Thread(producer[i]);
		}
		for(int i = 0 ;i<3 ;i++)
		{
			cthread[i].start();
		}
		for(int i = 0 ;i<4 ;i++)
		{
			pthreader[i].start();
		}
	}
}
